package cn.kkcxy.blog.core.enums;

public enum WeChatMessageTypeEnum {

    SUBSCRIBE("event.subscribe", "用户关注事件"),
    TEXT_MSG("text", "接收用户文本消息");

    private final String msgType;

    private final String desc;

    WeChatMessageTypeEnum(String msgType, String desc) {
        this.msgType = msgType;
        this.desc = desc;
    }

    public static WeChatMessageTypeEnum getByMsgType(String msgType) {
        for (WeChatMessageTypeEnum weChatMessageTypeEnum : WeChatMessageTypeEnum.values()) {
            if (weChatMessageTypeEnum.msgType.equals(msgType)) {
                return weChatMessageTypeEnum;
            }
        }
        return null;
    }

}
